package org.itboys.mobile.service.mongo.site;

import org.itboys.mobile.dto.SundayAdvertisementDto;
import org.itboys.mobile.entity.mysql.product.SundayProductCategory;
import org.itboys.mobile.service.mysql.web.product.SundayProductCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.ui.Model;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 作者：zzq
 * 时间：2017/10/27
 * 描述：雄安加盟网_加载一些乱七八糟的东西
 */
@Service
public class JoinSiteCountService {
    @Autowired
    private SundaySiteAdvertiseMentService advertiseMentService;
    @Autowired
    private SundayProductCategoryService categoryService;
    public void count(Model model){
        //加载战略合作
        List<SundayAdvertisementDto> zhanluehezuos =advertiseMentService.getAdvertisementByZone("zhanluehezuo");
        model.addAttribute("zhanluehezuos",zhanluehezuos);
        //加载友情链接
        List<SundayAdvertisementDto> youqinglianjies =advertiseMentService.getAdvertisementByZone("youqinglianjie");
        model.addAttribute("youqinglianjies",youqinglianjies);
        //加载常用搜索关键词
        List<SundayAdvertisementDto> common_searchs =advertiseMentService.getAdvertisementByZone("common_search");
        model.addAttribute("common_searchs",common_searchs);
        Map<String,Object> param=new HashMap<String,Object>();
        //加载一级行业分类
        param.put("parentId",0);
        param.put("sort_name","sequence");
        param.put("sort_order","asc");
        List<SundayProductCategory> categories= categoryService.select(param);
        model.addAttribute("categories",categories);
    }
}
